Skip to content

Hotfix Changelog — Noisefloor Freeze on Older Firmware#175

Merged
MrAlders0n merged 1 commit intomainfrom
dev
Jan 10, 2026
Merged

Hotfix Changelog — Noisefloor Freeze on Older Firmware#175
MrAlders0n merged 1 commit intomainfrom
dev

Conversation

@MrAlders0n
Copy link
Collaborator

Fixed
Prevented app freeze when noisefloor collection is attempted on MeshCore companion firmware < 1.11.0.
Added a firmware capability gate: noisefloor collection is only enabled when device firmware is v1.11.0+ (parsed from the device-reported model string). Nightly builds are treated as supported.
Improved
Added a 5s timeout safety fallback to noisefloor/radio stats requests to avoid indefinite waits even if a device fails to respond.
UI / Logging
When noisefloor is unsupported, the UI shows “-” for noisefloor and an entry is added to the Error Log indicating noisefloor requires 1.11.0+.

Copilot AI review requested due to automatic review settings January 10, 2026 20:27
@MrAlders0n MrAlders0n merged commit f2f4974 into main Jan 10, 2026
2 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This hotfix addresses an app freeze issue when attempting noisefloor collection on MeshCore companion firmware versions older than 1.11.0. The PR implements a firmware capability gate that parses the device's firmware version from its model string and only attempts noisefloor collection for firmware v1.11.0 or newer (nightly builds are assumed to support the feature). A 5-second timeout is added as a safety fallback to prevent indefinite waits if the device fails to respond.

Changes:

  • Added firmware version parsing from device model strings with regex pattern matching
  • Implemented capability gate to conditionally enable noisefloor collection based on firmware version
  • Added 5-second timeout to both initial and periodic radio stats requests
  • Enhanced error logging and UI feedback for unsupported firmware versions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
docs/CONNECTION_WORKFLOW.md Documents the firmware version parsing logic, capability gate behavior, and UI/error handling for unsupported firmware
content/wardrive.js Adds firmware version parsing functions, implements capability gate in connection flow, adds timeout to radio stats requests, and enhances error logging

} else {
debugWarn(`[BLE] getRadioStats failed on connect: ${e && e.message ? e.message : String(e)}`);
}
state.lastNoiseFloor = null; // Show '-' instead of 'ERR' for unsupported feature
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment states "Show '-' instead of 'ERR' for unsupported feature" but the actual UI behavior (in setConnStatus at line 1208) displays "Firmware 1.11+" when state.lastNoiseFloor is null, not "-". The comment should be updated to reflect the actual UI behavior.

Suggested change
state.lastNoiseFloor = null; // Show '-' instead of 'ERR' for unsupported feature
state.lastNoiseFloor = null; // Flag as unsupported so UI shows "Firmware 1.11+" instead of "ERR"

Copilot uses AI. Check for mistakes.
debugLog("[BLE] Started periodic noise floor updates (5s interval)");
} else {
debugWarn(`[BLE] getRadioStats failed on connect: ${e && e.message ? e.message : String(e)}`);
debugLog("[BLE] Noise floor updates not started (feature unsupported by firmware)");
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug log message is misleading when the initial radio stats request fails. At this point, we already know the firmware supports noisefloor (checked at line 5828), so the message "feature unsupported by firmware" at line 5857 is inaccurate. It should indicate that the initial request failed, not that the feature is unsupported. Consider changing the message to something like "Noise floor updates not started (initial request failed)" to avoid confusion during debugging.

Suggested change
debugLog("[BLE] Noise floor updates not started (feature unsupported by firmware)");
debugLog("[BLE] Noise floor updates not started (initial request failed)");

Copilot uses AI. Check for mistakes.
Comment on lines +156 to +158
- Stores noise floor in `state.lastNoiseFloor`
- Connection bar displays `🔊 <value>dBm`
- Starts periodic 5-second updates via `startNoiseFloorUpdates()`
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation implies that periodic updates are always started when firmware supports noisefloor, but the implementation only starts them if the initial radio stats request succeeds. Consider adding a clarification that periodic updates are only started if the initial request returns a valid noisefloor value. For example: "Starts periodic 5-second updates via startNoiseFloorUpdates() if initial request succeeds"

Suggested change
- Stores noise floor in `state.lastNoiseFloor`
- Connection bar displays `🔊 <value>dBm`
- Starts periodic 5-second updates via `startNoiseFloorUpdates()`
- **If initial request succeeds and returns a valid noisefloor value**:
- Stores noise floor in `state.lastNoiseFloor`
- Connection bar displays `🔊 <value>dBm`
- Starts periodic 5-second updates via `startNoiseFloorUpdates()`
- **If initial request fails or returns no valid noisefloor**:
- Periodic noise floor updates are **not** started
- Connection continues without noise floor display/updates

Copilot uses AI. Check for mistakes.
- **If not supported** (< 1.11.0):
- Skips `getRadioStats()` call entirely (prevents app freeze)
- Sets `state.lastNoiseFloor = null`
- Connection bar displays `🔊 -`
Copy link

Copilot AI Jan 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation states the connection bar displays "🔊 -" when noisefloor is not supported, but the actual UI implementation (setConnStatus function at line 1208) displays "🔊 Firmware 1.11+" when state.lastNoiseFloor is null. The documentation should be updated to reflect the actual UI behavior.

Suggested change
- Connection bar displays `🔊 -`
- Connection bar displays `🔊 Firmware 1.11+`

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants